package org.oslims.client.view.impl;

import org.oslims.client.uicomponents.editbox.EditOperatorBox;
import org.oslims.client.view.OperatorEditorView;
import org.oslims.domain.Operator;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.cellview.client.SimplePager;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.VerticalPanel;

public class OperatorEditorViewImpl extends BaseViewImpl implements OperatorEditorView {

	final Button addOperatorButton = new Button("Add Operator");
	Integer defaultPageSize = 15;
	final CellTable<Operator> operatorTable = new CellTable<Operator>(defaultPageSize);
	final SimplePager<Operator> pager = new SimplePager<Operator>(operatorTable);

	EditOperatorBox editOperatorBox = new EditOperatorBox();

	public OperatorEditorViewImpl() {
		VerticalPanel vp = new VerticalPanel();

		vp.add(operatorTable);
		vp.add(pager);
		vp.add(addOperatorButton);
		initWidget(vp);
	}

	@Override
	public HasClickHandlers getAddOperatorButton() {
		return addOperatorButton;
	}

	@Override
	public CellTable<Operator> getTable() {
		return operatorTable;
	}

	@Override
	public EditOperatorBox getEditOperatorBox() {
		return editOperatorBox;
	}

	@Override
	public Integer getDefaultPageSize() {
		return defaultPageSize;
	}

	@Override
	public SimplePager<Operator> getPager() {
		return pager;
	}

}
